<?php

namespace app\admin\validate\tyyh;

use app\common\validate\tyyh\User as ParentUser;

class User extends ParentUser
{
	/**
     * 验证规则
     */
    protected $rule = [
        'lock'                => 'require',
        'id'                  => 'require',
        'username'            => 'length:4,32'
    ];


    /**
     * 提示消息
     */
    protected $message = [
        'lock.require'                  => '验证规则场景不存在',
        'id.require'                    => '用户ID不能为空',
        'username.require'              => '用户名称不能为空',
        'username.length'               => '用户名称必须在4到32个字符之间',
        'username.isSetUsername'        => '用户名已经设置',
        'username.isSetUsername,!'      => '请先设置用户名',
        'username.xunique'              => '用户名已存在'
    ];
    /**
     * 验证场景
     */
    protected $scene = [
        'edit'         => ['username' => 'xunique:tyyh\\User'],
        'set_password' => ['id', 'password' => 'require|length:4,32']
    ];
}